/**
 * 
 */
package dms.presentation.action.sys;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import dms.model.School;
import dms.model.util.PageIterator;
import dms.service.SchoolService;
import dms.util.Constant;
import dms.util.ContextUtil;

/**
 * @author 李健
 *
 */
public class AddTeacherFormAction extends Action {
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		SchoolService schoolService = (SchoolService) ContextUtil.getContext().getBean("schoolService");
		PageIterator<School> iter = schoolService.findAllSchool(0, 100);
		
		request.setAttribute("page", iter);
		return mapping.findForward(Constant.SUCCESS);
		
	}
}
